<html>
<head>

<!-- Project Sponsor - http://www.devfuel.com-->
<!-- Project Page - http://gcalview.googlecode.com -->
<!-- License - MIT License -->

<title>gcalview-0.0.4.97 HTML Example : Inline Version</title>

  <!-- no includes needed...code is "inline" below-->
  
</head>
<body>

<!--BEGIN INLINE CODE-->
<script type="text/javascript" ><!-- 
var _gcv=new Object();GCalView.on_feed_completed=function(A){_gcv.instance.on_feed_completed(A);
};GCalView.render=function(A){_gcv.instance=new GCalView(A);};function GCalView(A){this.date_format="%a, %b %f";
this.time_format="%I:%M%p";this.feeds=new Object();this.evts=new Array(0);this.div=new Object();
this.feeds_left=-1;this.feeds_total=-1;this.evt=0;this.window=null;this.params=A;
this.render();}GCalView.prototype.on_feed_completed=function(B){var I=this.feeds.length;
this.feeds[B.feed.title.$t]=B.feed;var F=this.evts.length;if(B.feed.entry!=null){var H=B.feed.entry.length;
this.evts[F+H-1]=null;for(var A=0;A<H;A++){var C=B.feed.entry[A];C.startDate=this.gcal_time_as_date(C["gd$when"][0].startTime);
if(typeof C["gd$when"][0].endTime=="undefined"){C.endDate=null;C.allDay=true;}else{C.endDate=this.gcal_time_as_date(C["gd$when"][0].endTime);
var J=C.startDate.getDate();var D=C.endDate.getDate();C.daySpan=D-J;if(C.daySpan<1){C.allDay=false;
}else{if(C.daySpan==1){var G=C.startDate.getHours();var E=C.endDate.getHours();if((G==E)&&(G+E==0)){C.allDay=true;
C.daySpan=1;}}else{C.allDay=false;}}}C.srcFeed=I;this.evts[F+A]=C;}}this.feeds_left--;
this.display_status("Loading Events...",this.feeds_total-this.feeds_left,this.feeds_total+2);
if(this.feeds_left<1){this.render_evts();}};GCalView.prototype.render=function(){this.feeds_left=this.feeds_total=this.params.feeds.length;
this.div.root=document.getElementById(this.params.id);this.div.status=document.createElement("div");
this.div.status.setAttribute("class","status");this.div.status.setAttribute("id","status");
this.div.evts=document.createElement("div");this.div.evts.setAttribute("class","evts");
this.div.evts.setAttribute("id","evts");this.div.root.appendChild(this.div.status);
this.div.root.appendChild(this.div.evts);this.display_status("Loading Events...",0,this.feeds_total+2);
for(var A=0;A<this.params.feeds.length;A++){document.write("<script type='text/javascript' src='http://www.google.com/calendar/feeds/"+this.params.feeds[A]+"/public/full?alt=json-in-script&callback=GCalView.on_feed_completed&orderby=starttime&max-results=15&singleevents=true&sortorder=ascending&futureevents=true'></script>");
}};GCalView.prototype.display_status=function(D,C,A){var E=100*C/A;if(this.div.status==null){this.div.status=document.getElementById("status");
}while(this.div.status.childNodes.length>0){this.div.status.removeChild(this.div.status.childNodes[0]);
}this.div.status.appendChild(document.createTextNode(D));var B=document.createElement("div");
B.setAttribute("class","progress");var F=document.createElement("div");F.setAttribute("style","width: "+E+"px;");
F.setAttribute("class","progressbar");B.appendChild(F);this.div.status.appendChild(B);
};GCalView.prototype.clear_status=function(){if(this.div.status==null){this.div.status=document.getElementById("status");
}while(this.div.status.childNodes.length>0){this.div.status.removeChild(this.div.status.childNodes[0]);
}};GCalView.prototype.render_evts=function(){function F(J,K){return J.startDate.getTime()-K.startDate.getTime();
}var H=document.getElementById("evts");this.display_status("Sorting Events...",this.feeds_total,this.feeds_total+2);
this.evts.sort(F);var D=null;var I=this.build_evt_cats();var C=0;var E=I[0];var B=null;
this.display_status("Rendering Events...",this.feeds_total+1,this.feeds_total+2);
for(var A=0;A<this.evts.length;A++){B=this.evts[A];while(true){var G=this.evt_in_cat(B,E);
if(G==true){if(E.Section==null){this.build_evt_section(E,H);}this.render_evt(B,E);
break;}else{if(C<I.length-1){E=I[++C];}else{break;}}}}this.clear_status();};GCalView.prototype.evt_in_cat=function(B,E){if(E.Start==null&&E.End==null){return true;
}var A=B.startDate.getTime();var F=B.endDate.getTime();var D=A-E.End.getTime()>0;
var C=F-E.Start.getTime()<0;return(!D&&!C);};GCalView.prototype.build_evt_cats=function(){var C=new Date();
var K=new Object();var B=new Object();var A=new Object();var F=new Object();var L=new Object();
var J=new Object();var D=new Object();var G=C.getMonth();var I=C.getFullYear();var H=C.getDate();
var E=C.getDay();K.Start=this.build_date(I,G,H,true);K.End=this.build_date(I,G,H,false);
K.Section=null;K.DateFormat=this.time_format;K.TimeFormat=this.time_format;K.MultiDateFormat=this.date_format;
K.Caption="Today";K.Range=K.Start.print(this.date_format);B.Start=this.build_date(I,G,H-E,true);
B.End=this.build_date(I,G,H+6-E,false);B.Section=null;B.DateFormat=this.date_format;
B.TimeFormat=this.time_format;B.MultiDateFormat=this.date_format;B.Caption="This Week";
B.StartMonth=B.Start.print("%b");B.EndMonth=B.End.print("%b");if(B.StartMonth==B.EndMonth){B.EndMonth="";
}else{B.EndMonth=B.EndMonth+" ";}B.Range=B.Start.print("%b %f - ")+B.EndMonth+B.End.print("%f");
A.Start=this.build_date(I,G,H-E+7,true);A.End=this.build_date(I,G,H+13-E,false);A.Section=null;
A.DateFormat=this.date_format;A.TimeFormat=this.time_format;A.MultiDateFormat=this.date_format;
A.Caption="Next Week";A.StartMonth=A.Start.print("%b");A.EndMonth=A.End.print("%b");
if(A.StartMonth==A.EndMonth){A.EndMonth="";}else{A.EndMonth=A.EndMonth+" ";}A.Range=A.Start.print("%b %f - ")+A.EndMonth+A.End.print("%f");
F.Start=this.build_date(I,G,0,true);F.End=this.build_date(I,G+1,-1,false);F.Section=null;
F.DateFormat=this.date_format;F.TimeFormat=this.time_format;F.MultiDateFormat=this.date_format;
F.Caption="This Month";F.Range=F.Start.print("%b %Y");L.Start=this.build_date(I,G+1,1,true);
L.End=this.build_date(I,G+2,-1,false);L.Section=null;L.DateFormat=this.date_format;
L.TimeFormat=this.time_format;L.MultiDateFormat=this.date_format;L.Caption="Next Month";
L.Range=L.Start.print("%b %Y");J.Start=this.build_date(I,0,1,true);J.End=this.build_date(I+1,0,-1,false);
J.Section=null;J.DateFormat=this.date_format;J.TimeFormat=this.time_format;J.MultiDateFormat=this.date_format;
J.Caption="This Year";J.Range=K.Start.print("%Y");D.Start=null;D.End=null;D.Section=null;
D.DateFormat=this.date_format;D.DateFormat="%I:%M%p";D.TimeFormat="%I:%M%p";D.MultiDateFormat=this.date_format;
D.Caption="Upcoming";D.Range="";return new Array(K,B,A,F,L,J,D);};GCalView.prototype.build_date=function(B,A,D,E){var C=new Date(B,A,D);
if(E==false){C.setHours(23);C.setMinutes(59);C.setSeconds(59);C.setMilliseconds(999);
}else{C.setHours(0);C.setMinutes(0);C.setSeconds(0);C.setMilliseconds(0);}return C;
};GCalView.prototype.render_when=function(A,D){var G=A.startDate.print(D.DateFormat);
if(A.allDay){G=A.startDate.print(D.DateFormat);}else{if(A.daySpan>0){G=A.startDate.print(D.DateFormat)+" - "+A.endDate.print(D.MultiDateFormat);
}else{if(A.daySpan==0){G=A.startDate.print(D.DateFormat)+" ";var E=A.startDate.print("%i");
var F=A.startDate.print("%M");var I=A.startDate.print("%p");var C=A.endDate.print("%i");
var H=A.startDate.print("%M");var B=A.endDate.print("%p");if(I==B){I="";}if(F=="00"){F="";
}else{F=":"+F;}if(H=="00"){H="";}else{H=":"+H;}G=G+E+F+I+"-"+C+H+B;}}}return G;};
GCalView.prototype.render_evt=function(B,C){var E=B.title.$t;var M=B.gd$where[0].valueString;
if(typeof M!="undefined"){M="<a href='http://maps.google.com/maps?hl=en&q="+encodeURI(M)+"'>Map</a>";
}else{M="Not Specified";}var L=B.content.$t;if(typeof L=="undefined"){L="None";}var J=B["gd$when"][0].startTime;
var F="Unknown";if(typeof B.author[0].name!="undefined"){F=B.author[0].name.$t;}for(var K=0;
K<B["link"].length;K++){if(B["link"][K]["type"]=="text/html"&&B["link"][K]["rel"]=="alternate"){var H=B["link"][K]["href"];
}}var G=this.render_when(B,C);var I=document.createElement("li");var A=E;if(typeof H!="undefined"){entryLink=document.createElement("a");
entryLink.setAttribute("id","evt_link_"+this.evt);entryLink.setAttribute("class","toggle");
entryLink.setAttribute("href","javascript:GCalView.toggle_evt_detail("+String(this.evt)+")");
entryLink.appendChild(document.createTextNode("[+]"));I.appendChild(entryLink);I.appendChild(document.createTextNode(" "+E+" : "+G));
A="<a href='"+H+"'>"+E+"</a>";}else{I.appendChild(document.createTextNode(E+" : "+G));
}var D=document.createElement("div");D.setAttribute("id","evt_div_"+this.evt);D.setAttribute("class","evt_detail");
this.evt++;D.innerHTML="What: ".bold()+A+"<br/>"+"When: ".bold()+G+"<br/>"+"Where: ".bold()+M+"<br/>"+"Calendar: ".bold()+F+"<br/>"+"Description: ".bold()+"<div class='description'>"+L+"</div>";
D.style.display="none";I.appendChild(D);C.Section.appendChild(I);};GCalView.toggle_evt_detail=function(C){var B=document.getElementById("evt_div_"+C);
var A=document.getElementById("evt_link_"+C);if(B.style.display=="none"){B.style.display="block";
A.innerHTML="[-]";}else{if(B.style.display=="block"){B.style.display="none";A.innerHTML="[+]";
}}};GCalView.prototype.build_evt_section=function(D,B){var F=document.createElement("div");
F.setAttribute("class","timespan");var E=document.createElement("div");E.setAttribute("class","caption");
E.appendChild(document.createTextNode(D.Caption));var A=document.createElement("span");
A.setAttribute("class","range");A.appendChild(document.createTextNode(D.Range));F.appendChild(E);
E.appendChild(A);var C=document.createElement("ul");F.appendChild(C);B.appendChild(F);
D.Section=C;};GCalView.prototype.gcal_time_as_date=function(H){var E=H;function J(Q){var P=E.match(new RegExp("^"+Q));
if(P){E=E.substring(P[0].length);return P[0];}return"";}var N=0;var O=J("\\d{4}");
J("-?");var D=J("\\d{2}");J("-?");var A=J("\\d{2}");var M=J("T");var L=0;var K=0;
if(M=="T"){L=J("\\d{2}");J(":?");K=J("\\d{2}");J("(:\\d{2})?(\\.\\d{3})?");var C=J("Z");
if(C!="Z"){var B=J("[\\+\\-]");if(B!=""){var F=J("\\d{2}");J(":?");var I=J("\\d{2}");
N=(B=="-"?1:-1)*(Number(F)*60+(I==""?0:Number(I)));}}}var G=new Date(O,D-1,A,L,K);
return G;};_gcv._DN=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");
_gcv._SDN=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun");_gcv._FD=0;_gcv._MN=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
_gcv._SMN=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
Date._MD=new Array(31,28,31,30,31,30,31,31,30,31,30,31);Date.SECOND=1000;Date.MINUTE=60*Date.SECOND;
Date.HOUR=60*Date.MINUTE;Date.DAY=24*Date.HOUR;Date.WEEK=7*Date.DAY;Date.parseDate=function(I,K){var L=new Date();
var E=0;var D=-1;var H=0;var F=I.split(/\W+/);var G=K.match(/%./g);var A=0,B=0;var M=0;
var C=0;for(A=0;A<F.length;++A){if(!F[A]){continue;}switch(G[A]){case"%d":case"%e":H=parseInt(F[A],10);
break;case"%m":D=parseInt(F[A],10)-1;break;case"%Y":case"%y":E=parseInt(F[A],10);
(E<100)&&(E+=(E>29)?1900:2000);break;case"%b":case"%B":for(B=0;B<12;++B){if(_gcv._MN[B].substr(0,F[A].length).toLowerCase()==F[A].toLowerCase()){D=B;
break;}}break;case"%H":case"%I":case"%k":case"%l":M=parseInt(F[A],10);break;case"%P":case"%p":if(/pm/i.test(F[A])&&M<12){M+=12;
}else{if(/am/i.test(F[A])&&M>=12){M-=12;}}break;case"%M":C=parseInt(F[A],10);break;
}}if(isNaN(E)){E=L.getFullYear();}if(isNaN(D)){D=L.getMonth();}if(isNaN(H)){H=L.getDate();
}if(isNaN(M)){M=L.getHours();}if(isNaN(C)){C=L.getMinutes();}if(E!=0&&D!=-1&&H!=0){return new Date(E,D,H,M,C,0);
}E=0;D=-1;H=0;for(A=0;A<F.length;++A){if(F[A].search(/[a-zA-Z]+/)!=-1){var J=-1;for(B=0;
B<12;++B){if(_gcv._MN[B].substr(0,F[A].length).toLowerCase()==F[A].toLowerCase()){J=B;
break;}}if(J!=-1){if(D!=-1){H=D+1;}D=J;}}else{if(parseInt(F[A],10)<=12&&D==-1){D=F[A]-1;
}else{if(parseInt(F[A],10)>31&&E==0){E=parseInt(F[A],10);(E<100)&&(E+=(E>29)?1900:2000);
}else{if(H==0){H=F[A];}}}}}if(E==0){E=L.getFullYear();}if(D!=-1&&H!=0){return new Date(E,D,H,M,C,0);
}return L;};Date.prototype.getMonthDays=function(A){var B=this.getFullYear();if(typeof A=="undefined"){A=this.getMonth();
}if(((0==(B%4))&&((0!=(B%100))||(0==(B%400))))&&A==1){return 29;}else{return Date._MD[A];
}};Date.prototype.getDayOfYear=function(){var C=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);
var A=new Date(this.getFullYear(),0,0,0,0,0);var B=C-A;return Math.floor(B/Date.DAY);
};Date.prototype.getWeekNumber=function(){var C=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);
var A=C.getDay();C.setDate(C.getDate()-(A+6)%7+3);var B=C.valueOf();C.setMonth(0);
C.setDate(4);return Math.round((B-C.valueOf())/(7*86400000))+1;};Date.prototype.equalsTo=function(A){return((this.getFullYear()==A.getFullYear())&&(this.getMonth()==A.getMonth())&&(this.getDate()==A.getDate())&&(this.getHours()==A.getHours())&&(this.getMinutes()==A.getMinutes()));
};Date.prototype.setDateOnly=function(A){var B=new Date(A);this.setDate(1);this.setFullYear(B.getFullYear());
this.setMonth(B.getMonth());this.setDate(B.getDate());};Date.prototype.print=function(G){var J=this.getMonth();
var N=this.getDate();var A=this.getFullYear();var E=this.getWeekNumber();var F=this.getDay();
var D={};var P=this.getHours();var R=(P>=12);var Q=(R)?(P-12):P;var L=this.getDayOfYear();
if(Q==0){Q=12;}var I=this.getMinutes();var B=this.getSeconds();D["%a"]=_gcv._SDN[F];
D["%A"]=_gcv._DN[F];D["%b"]=_gcv._SMN[J];D["%B"]=_gcv._MN[J];D["%C"]=1+Math.floor(A/100);
D["%d"]=(N<10)?("0"+N):N;D["%f"]=String(N);var K=D["%f"].length==2?D["%f"].charAt(0):null;
if(K=="1"){D["%f"]+="th";}else{var M=D["%f"].charAt(D["%f"].length-1);if(M=="1"){D["%f"]+="st";
}else{if(M=="2"){D["%f"]+="nd";}else{if(M=="3"){D["%f"]+="rd";}else{D["%f"]+="th";
}}}}D["%e"]=N;D["%H"]=(P<10)?("0"+P):P;D["%I"]=(Q<10)?("0"+Q):Q;D["%i"]=Q;D["%j"]=(L<100)?((L<10)?("00"+L):("0"+L)):L;
D["%k"]=P;D["%l"]=Q;D["%m"]=(J<9)?("0"+(1+J)):(1+J);D["%M"]=(I<10)?("0"+I):I;D["%n"]="\n";
D["%p"]=R?"p":"a";D["%P"]=R?"pm":"am";D["%s"]=Math.floor(this.getTime()/1000);D["%S"]=(B<10)?("0"+B):B;
D["%t"]="\t";D["%U"]=D["%W"]=D["%V"]=(E<10)?("0"+E):E;D["%u"]=F+1;D["%w"]=F;D["%y"]=(""+A).substr(2,2);
D["%Y"]=A;D["%%"]="%";var S=/%./g;if(!_gcv.is_ie5&&!_gcv.is_khtml){return G.replace(S,function(T){return D[T]||T;
});}var O=G.match(S);for(var H=0;H<O.length;H++){var C=D[O[H]];if(C){S=new RegExp(O[H],"g");
G=G.replace(S,C);}}return G;};Date.prototype.__msh_oldSetFullYear=Date.prototype.setFullYear;
Date.prototype.setFullYear=function(A){var B=new Date(this);B.__msh_oldSetFullYear(A);
if(B.getMonth()!=this.getMonth()){this.setDate(28);}this.__msh_oldSetFullYear(A);
};_gcv.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));
_gcv.is_ie5=(_gcv.is_ie&&/msie 5\.0/i.test(navigator.userAgent));_gcv.is_opera=/opera/i.test(navigator.userAgent);
_gcv.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent); 
--></script>
<style type="text/css"><!--
div.status{float:left;width:100%;}div.evts{float:left;width:100%;}.evts .toggle{text-decoration:none;}div.evt_detail{border-left:1px solid #AAA;margin-left:3px;padding-left:3px;width:100%;text-indent:0;}.timespan .caption{font-weight:bolder;border-bottom:1px solid #AAA;}.timespan .range{padding-left:.8em;font-weight:normal;font-variant:small-caps;font-size:smaller;color:silver;}.timespan ul{font-size:smaller;text-indent:-4px;padding-left:8px;list-style-position:outside;list-style-image:url(arrow.gif);list-style-type:square;}.progress{width:100px;height:5px;background:#ddd;border:solid black 1px;}.progressbar{height:100%;background:#AAA;}
--></style>
<div id="gcv"></div>
<script type="text/javascript">
   GCalView.render({id : "gcv", 
	  feeds : 
	  [	
         "sba732kkpe5lg2ed3d0i16s1vc@group.calendar.google.com", //Movie and DVD releases
         "usa__en@holiday.calendar.google.com", //US Holidays
         "3nc7u0oo0k46pe6npe7k629ubhifjm3s@import.calendar.google.com" //Geek Holidays
      ]
    });
</script>
<!--END INLINE CODE-->

</body>
</html>
